feat: add per-method RPC timeout configuration#110
Open
KENILSHAHH wants to merge 1 commit intomegaeth-labs:mainfrom
Open
feat: add per-method RPC timeout configuration#110KENILSHAHH wants to merge 1 commit intomegaeth-labs:mainfrom
KENILSHAHH wants to merge 1 commit intomegaeth-labs:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
the tradeoff between witness fetches (which can legitimately take several
seconds on heavy blocks) and block/header fetches (which should return in
milliseconds). A single tight timeout caused false witness failures; a single
loose one left workers hanging on stuck block fetches.
block_timeout,witness_timeout, andcode_timeoutfields(
Option<Duration>) toRpcClientConfigwith correspondingwith_*buildermethods. All default to
None— fully backwards compatible.apply_timeouthelper onRpcClientthat wraps any future withtokio::time::timeoutwhen a timeout is set, and passes through with zerooverhead when
None.code_timeouttoget_code,block_timeouttoget_block_unchecked/get_latest_block_number/get_header/get_transaction_by_hash, andwitness_timeouttofetch_witness_from_provider(covers both primary andCloudflare fallback paths).
--block-timeout-secs,--witness-timeout-secs,--code-timeout-secsCLI flags (and
STATELESS_VALIDATOR_*_TIMEOUT_SECSenv vars) in thestateless-validatorbinary so operators can tune timeouts at deploy timewithout recompiling.